﻿using BaMusaSoft.RPS.WinIRSService;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using BaMusaSoft.RPS.DataModel;
using System.Collections.Generic;

namespace WinIRSTest
{
    
    
    /// <summary>
    ///This is a test class for WinIRSDataTest and is intended
    ///to contain all WinIRSDataTest Unit Tests
    ///</summary>
    [TestClass()]
    public class WinIRSDataTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        string accessDbPath = @"C:\Users\Abdullah\Documents\BaMusaSoft\Access Databases\Property.mdb"; 
        /// <summary>
        ///A test for GetContracts
        ///</summary>
        [TestMethod()]
        public void GetContractsTest()
        {
            
            WinIRSData target = new WinIRSData(accessDbPath); 
            IList<Contract> actual;
            actual = target.GetContracts();
            Assert.IsTrue(actual.Count >= 0);
            
        }

        /// <summary>
        ///A test for GetCustomers
        ///</summary>
        [TestMethod()]
        public void GetCustomersTest()
        {
            WinIRSData target = new WinIRSData(accessDbPath); 
            IList<Customer> actual;
            actual = target.GetCustomers();
            Assert.IsTrue(actual.Count >= 0);
        }

        /// <summary>
        ///A test for GetPayments
        ///</summary>
        [TestMethod()]
        public void GetPaymentsTest()
        {
            WinIRSData target = new WinIRSData(accessDbPath);
            IList<Payment> actual;
            actual = target.GetPayments(31);
            Assert.IsTrue( actual.Count >= 0);
        }

        /// <summary>
        ///A test for GetCustomers
        ///</summary>
        [TestMethod()]
        public void GetPropertiesTest()
        {
            WinIRSData target = new WinIRSData(accessDbPath);
            IList<Property> actual;
            actual = target.GetProperties();
            Assert.IsTrue(actual.Count >= 0);
        }
    }
}
